<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateConfigTable extends Migration
{
    public function up()
    {
        Schema::create('config', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('ID');
            $table->string('key')->comment('键值');
            $table->string('name')->comment('名称');
            $table->timestamp('created_at')->nullable()->comment('创建时间');
            $table->timestamp('updated_at')->nullable()->comment('修改时间');
            $table->timestamp('deleted_at')->nullable()->comment('删除时间');

        });
        DB::statement('alter table'. ' ' .config('database.connections.mysql.prefix', '').'config comment "配置表"');

    }

    public function down()
    {
        Schema::dropIfExists('config');     // 配置表
    }
}
